home *** CD-ROM | disk | FTP | other *** search
/ Ultra Pack / UltraComputing Partner Applications.iso / run_demo < prev   
Text File  |  1996-06-10  |  5KB  |  144 lines

  1. #!/bin/sh
  2. ####################################################################################
  3. #                                                                                  #
  4. #  Copyright (c) 1996, Sun Microsystems Computer Corporation, Mountain View, CA    #
  5. #                                                                                  #
  6. #                      All Rights Reserved                                         #
  7. #                                                                                  #
  8. # Sun Microsystems Computer Corporation disclaims all warranties with              #
  9. # regard to this software, including all implied warranties of merchantability     #
  10. # and fitness.  In no event will Sun Microsystems Inc., Sun Microsystems           #
  11. # Computer Corporation or any Sun Microsystems Inc. company, its employees         #
  12. # or agents be liable for direct, incidental or consequential damages              #
  13. # resulting from loss of data or business opportunities, resulting from the        #
  14. # Ultracomputing Demo CD, or any part of same, either alone or in conjunction      #
  15. # with other programs.                                                             #
  16. #                                                                                  #
  17. # The software contained on these discs is distributed as is, at no additional     #
  18. # charge. As such, it is excluded from any pre-existing customer service        #
  19. # or support agreements with Sun Microsystems. An email form is provided in        #
  20. # the main demo menu to direct comments, feedback and technical questions          #
  21. # relating strictly to Ultrapack, the demos and usage thereof.               #
  22. #                                                                                  #
  23. # run_demo:                                       #
  24. #                                                                                  #
  25. # Executable shell script for starting up the UltraPack                   #
  26. #         SMCC Desktop Systems Engineering                   #
  27. #        June 1996                                  #
  28. #                                                                                  #
  29. ####################################################################################
  30. echo "Loading, Please Wait .........."
  31.  
  32. if [ "$ULTRA_PACK_HOME" = "" ]; then
  33.     ULTRA_PACK_HOME=/cdrom/cdrom0
  34.     export ULTRA_PACK_HOME
  35. fi
  36.  
  37. if [ "$DEMO_BROWSER" = "" ]; then
  38.     HOTJAVAHOME=$ULTRA_PACK_HOME/HotJava;
  39. else
  40.     echo "Using alternate directory for HotJava"
  41.     echo "Loading from: " $DEMO_BROWSER
  42.     HOTJAVAHOME=$DEMO_BROWSER;
  43. fi
  44.  
  45. export ULTRA_PACK_HOME
  46. DIR=$ULTRA_PACK_HOME
  47. export DIR
  48. #
  49. /bin/stty istrip
  50.  
  51. # This next section performs some magic tricks to prevent
  52. # HotJava from overriding the user's existing preferences.
  53. # By re-directing the $HOME env var to /tmp, HotJava will
  54. # look for a preferences file which we've created specifically 
  55. # for Ultrapack -- however, this also implies having some other
  56. # important files in the new "home" directory such as the Xdefaults
  57. # file and Xauthority file. 
  58. #
  59. cd /tmp
  60.  
  61. if [ -w /tmp/.Xdefaults ]; then
  62.         rm /tmp/.Xdefaults;
  63. fi
  64.  
  65. if [ -w /tmp/.Xauthority ]; then
  66.         rm /tmp/.Xauthority;
  67. fi
  68.  
  69. if [ -w /tmp/.mailcap ]; then
  70.         rm /tmp/.mailcap;
  71. fi
  72.  
  73. if [ -d /tmp/.hotjava ]; then
  74.         rm -rf /tmp/.hotjava;
  75. fi
  76. #
  77. # Unroll a temporary user directory in /tmp for 
  78. # HotJava so we don't step on the user's defaults.
  79. #
  80. tar xf $ULTRA_PACK_HOME/WWW/HotJavaPrefs.tar
  81. /bin/cp $HOME/.Xauthority /tmp/.
  82. HOME=/tmp
  83. export HOME
  84. #
  85. /usr/openwin/bin/xrdb -merge /tmp/.Xdefaults
  86. DISPLAY=:0.0
  87. export DISPLAY
  88. /usr/openwin/bin/xhost `/usr/bin/uname -n`
  89.  
  90. # The next set of variables are for specific libraries
  91. # and home variables of application components that we
  92. # already know about. If other applications are added
  93. # to the web, this is the place to define their env vars.
  94. #
  95. MOTIFHOME=/usr/dt
  96. export MOTIFHOME
  97.  
  98. XGLHOME=/opt/SUNWits/Graphics-sw/xgl
  99. export XGLHOME
  100.  
  101. XILHOME=/opt/SUNWits/Graphics-sw/xil
  102. export XILHOME
  103.  
  104. CLASSPATH=$ULTRA_PACK_HOME/WWW/classes:$HOTJAVAHOME/lib/classes.zip:$JAVAHOME/lib
  105. export CLASSPATH
  106.  
  107. #
  108. LD_LIBRARY_PATH=/usr/openwin/lib:$XGLHOME/lib:$MOTIFHOME/lib:$XILHOME/lib
  109. export LD_LIBRARY_PATH
  110. PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/usr/openwin/bin:/usr/bin:/usr/sbin:/usr/ucb:/etc
  111. export PATH
  112. #
  113. cd $ULTRA_PACK_HOME/WWW
  114. #
  115. # Figure out which video mode the user is in and display HotJava properly.
  116. #
  117. /usr/openwin/bin/xdpyinfo | grep 1280 > /tmp/vidmode
  118. if [ -s /tmp/vidmode ]; then
  119.     rm -f /tmp/vidmode;
  120.     $HOTJAVAHOME/bin/hotjava $ULTRA_PACK_HOME/WWW/index.html
  121. else
  122.     rm -f /tmp/vidmode;
  123.     $HOTJAVAHOME/bin/hotjava $ULTRA_PACK_HOME/WWW/index.html
  124. fi
  125. #
  126. # Clean up after ourselves
  127. cd /tmp
  128.  
  129. if [ -w /tmp/.Xdefaults ]; then
  130.         rm /tmp/.Xdefaults;
  131. fi
  132.  
  133. if [ -w /tmp/.Xauthority ]; then
  134.         rm /tmp/.Xauthority;
  135. fi
  136.  
  137. if [ -w /tmp/.mailcap ]; then
  138.         rm /tmp/.mailcap;
  139. fi
  140.  
  141. if [ -d /tmp/.hotjava ]; then
  142.         rm -rf /tmp/.hotjava;
  143. fi
  144.